home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / security / xinetd / xlog.1.0.9 / xlog.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-01-07  |  1.9 KB  |  74 lines

  1. /*
  2.  * (c) Copyright 1992 by Panagiotis Tsirigotis
  3.  * All rights reserved.  The file named COPYRIGHT specifies the terms 
  4.  * and conditions for redistribution.
  5.  */
  6.  
  7. #ifndef __XLOG_H
  8. #define __XLOG_H
  9.  
  10. /*
  11.  * $Id: xlog.h,v 1.5 1992/11/24 20:49:23 panos Exp $
  12.  */
  13.  
  14. /*
  15.  * Flags
  16.  */
  17. #define XLOG_NOFLAGS                    0x0
  18. #define XLOG_SET_LEVEL                0x1
  19. #define XLOG_NO_SIZECHECK            0x2
  20. #define XLOG_NO_ERRNO                0x4
  21. #define XLOG_PRINT_TIMESTAMP        0x8
  22. #define XLOG_PRINT_ID                0x10
  23. #define XLOG_PRINT_PID                0x20
  24.  
  25. /*
  26.  * Errors
  27.  */
  28. #define XLOG_ENOERROR                0
  29. #define XLOG_ESIZE                    1
  30. #define XLOG_EOPEN                    2
  31. #define XLOG_EFSTAT                    3
  32. #define XLOG_ENOMEM                    4
  33.  
  34. /*
  35.  * Interface
  36.  */
  37.  
  38. #ifdef __ARGS
  39. #undef __ARGS
  40. #endif
  41.  
  42. #ifdef PROTOTYPES
  43. #  define __ARGS( s )               s
  44. #else
  45. #  define __ARGS( s )               ()
  46. #endif
  47.  
  48. typedef enum { XLOG_SYSLOG, XLOG_FILELOG } xlog_e ;
  49.  
  50. typedef enum
  51.     {
  52.         XLOG_LINK,                /* generic: link this log to another log             */
  53.         XLOG_CALLBACK,            /* generic: call this function in case of error */
  54.         XLOG_GETFLAG,            /* generic:    get value of specified flag            */
  55.         XLOG_SETFLAG,            /* generic:    set value of specified flag            */
  56.         XLOG_LEVEL,                /* syslog:  set the default syslog level            */
  57.         XLOG_FACILITY,            /* syslog:  set the default syslog facility        */
  58.         XLOG_PREEXEC,            /* syslog:    prepare the log for an exec(2)        */
  59.         XLOG_POSTEXEC,            /* syslog:    exec(2) failed                                */
  60.         XLOG_SIZECHECK,        /* filelog: check file size                             */
  61.         XLOG_GETFD,                /* filelog: get file descriptor of log file        */
  62.         XLOG_LIMITS             /* filelog: set (new) soft/hard limits                */
  63.     } xlog_cmd_e ;
  64.  
  65. typedef void *xlog_h ;
  66.  
  67. xlog_h xlog_create __ARGS( ( xlog_e type, char *id, int flags, ... ) ) ;
  68. void xlog_destroy __ARGS( ( xlog_h ) ) ;
  69. void xlog_write __ARGS( ( xlog_h, char buf[], int len, int flags, ... ) ) ;
  70. void xlog_control __ARGS( ( xlog_h, xlog_cmd_e, ... ) ) ;
  71. int xlog_parms __ARGS( ( xlog_e type, ... ) ) ;
  72.  
  73. #endif    /* __XLOG_H */
  74.